package com.dfiov.cloud.msmtools.enums;

public enum RealNameStatusEnum {

    WAITING_AUTH(0, "待实名认证"),

    IN_AUTH(1, "认证中"),

    AUTH_SUCCESS(2, "实名认证通过"),

    AUTH_FAILURE(3, "实名认证失败"),

    APPLYING_FOR_TERMINATE(4, "解除申请中"),

    TERMINATE_AUTH_SUCCESS(5, "实名认证解除成功"),
    ;
    
    private Integer code;
    
    private String desc;
    
    public static String getDescByCode(Integer code) {
        
        if(code == null) {
            return null;
        }
        for (RealNameStatusEnum statusEnum : values()) {
            if(statusEnum.code == code) {
                return statusEnum.desc;
            }
        }
        return null;
    }

    private RealNameStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
